package com.examonline.controller;

import com.examonline.pojo.dto.LoginDTO;
import com.examonline.service.UserService;
import com.examonline.utils.result.Result;
import com.examonline.utils.result.ResultEnum;
import com.examonline.utils.result.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class LoginController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public Result login(@RequestBody LoginDTO loginDTO){
        Result login = userService.login(loginDTO);
        return login;
    }

}
